package com.zxj.userscenter.common.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.zxj.userscenter.common.util.DateFormatUtil;
import com.zxj.userscenter.common.util.VerifyCodeUtils;

/**
 * 所有controller的父类
 * @author zxj
 *
 */
@Controller
public class BaseController
{
	@Resource
	protected DateFormatUtil dateFormatUtil;
	/*提示信息*/
    protected String info;
    
    /*生产验证码*/
    @RequestMapping
    public String randImg(HttpServletRequest request, HttpServletResponse response)
    {
    	response.setHeader("Pragma", "No-cache");
    	response.setHeader("Cache-Control", "no-cache");
    	response.setDateHeader("Expires", 0);
		response.setContentType("image/jpeg");
		
		//成功随机字符串
		String verifyCode=VerifyCodeUtils.generateVerifyCode(4);
    	return null;
    }
}
